<template>
  <AdForm v-bind="fromConfig" v-model="models"></AdForm>
</template>
<script lang="ts" setup>
import { reactive, ref } from 'vue';
import type { AdFormPorps } from '@fe-hl/admin-design-vue';
interface Models {
  status: string;
}
const models = ref<Models>();
const fromConfig: AdFormPorps<Models> = reactive({
  span: 8,
  components: [
    {
      model: 'status',
      components: 'el-select',
      subComponents: 'el-option',
      options: () => {
        // 模拟ajax请求
        return new Promise((resolve) => {
          setTimeout(() => {
            resolve([
              {
                label: '启用',
                value: 'enable',
              },
              {
                label: '禁用',
                value: 'disable',
              },
            ]);
          }, 1000);
        });
      },
      props: {
        label: '状态',
      },
    },
  ],
  submit: (models) => {
    console.log(models);
  },
  resetForm: () => {
    console.log('resetForm');
  },
});
</script>
